<template>
	<view class="pointdetail_container">
		<view class="pointdetail_item" v-for="(item,index) in pointData" :key="index">
			<view class="pointdetail_top">
				<view class="pointdetail_buy">
					{{item.source}}
				</view>
				<view class="paintdetail_money">
					{{item.type_text + item.num}}
				</view>
			</view>
			<view class="paintdetail_time">
				{{item.create_time}}
			</view>
		</view>
	</view>
</template>

<script>
	import {pointList} from "../../api/point.js"
	export default{
		data(){
			return{
				num:0,
				pointData:[]
			}
		},
		onReachBottom() {
			this.getData()
		},
		onLoad() {
			this.getData()
		},
		methods:{
			getData(){
				this.num ++
				this.post(pointList,{
					user_id:uni.getStorageSync("userInfo").id,
					page:this.num
				}).then(res => {
					if(res.code == 1){
						this.pointData = [...this.pointData,...res.data.data]
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pointdetail_container{
		padding: 0 30rpx;
		.pointdetail_item{
			width: 690rpx;
			height:160rpx;
			border-bottom: 1px solid #D4D4D4;
			.pointdetail_top{
				display: flex;
				justify-content: space-between;
				padding-top: 43rpx;
				.pointdetail_buy{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					opacity: 1;
				}
				.pointdetail_money{
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 800;
					color: #333333;
					opacity: 1;
				}
			}
			.paintdetail_time{
				margin-top: 8rpx;
				padding-bottom: 12.5rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 300;
				color: #333333;
				opacity: 1;
			}
		}
	}
	
</style>
